package com.lc.user.express.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.lc.user.express.R;
import com.lc.user.express.app.AppContext;
import com.lc.user.express.model.MyStardtextModel;

import java.util.List;

/**
 * Created by Administrator on 2016/4/5.
 */
public class StaredTextAdapter extends BaseListAdapter<MyStardtextModel> {
    public StaredTextAdapter(Context context, List<MyStardtextModel> data) {
        super(context, data);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder viewHolder = null;
        MyStardtextModel myStard_textModel = data.get(position);
        if (convertView == null) {
            convertView = LayoutInflater.from(mContext).inflate(R.layout.item_list1_stardand, null);
            AppContext.ScaleScreenHelper.loadView((ViewGroup)convertView);
            viewHolder = new ViewHolder();
            viewHolder.text_list_stardand = (TextView) convertView.findViewById(R.id.text_list_stardand);
            convertView.setTag(viewHolder);
        }
        setContextView(convertView, myStard_textModel);

        return convertView;
    }

    private void setContextView(View convertView, MyStardtextModel myStard_textModel) {
        ViewHolder viewHolder = (ViewHolder) convertView.getTag();
        viewHolder.text_list_stardand.setText(myStard_textModel.getText_list_stardand());
    }

    public static class ViewHolder {
        TextView text_list_stardand;
    }
}
